<template>
  <!-- 摄像头列表组件 -->
  <div class="allcameramain">
    <!-- 摄像头列表 -->
    <div class="cameralistmain">
      <div class="camera-title">
        摄像头列表
      </div>
      <div v-if="cameraList.length" class="camera-zlist">
        <template v-for="(item, index) in cameraList">
          <div
            v-if="item.camera"
            :key="index"
            class="camera-item"
            :class="{
              beselect: item.camera.cameraId == cameraId,
            }"
            @click="getcamermes(item.camera, item.camera.startUp)"
          >
            <i class="el-icon-video-camera"></i>
            {{ item.camera.cameraName }}
          </div>
        </template>
      </div>
      <!-- 判断有没有摄像头数据 -->
      <div v-else class="camera-zlist zlistbtn">
        <div class="camera-item btn">暂无摄像头</div>
      </div>
    </div>
    <!-- 摄像头控制按钮 -->
    <div
      v-if="
        cameraInfoList &&
          cameraInfoList.controlFlag &&
          judgePermission(3, 'control')
      "
      class="cameracontrol"
    >
      <div class="controne">
        <div class="contro-m z-top" @click="startcontrol(0)">
          <i class="el-icon-caret-top"></i>
        </div>
        <div class="contro-m z-left" @click="startcontrol(2)">
          <i class="el-icon-caret-left"></i>
        </div>
        <div class="contro-m z-right" @click="startcontrol(3)">
          <i class="el-icon-caret-right"></i>
        </div>
        <div class="contro-m z-bottom" @click="startcontrol(1)">
          <i class="el-icon-caret-bottom"></i>
        </div>
        <div class="contro-m z-mirror" @click="mirrorcontrol()">
          <i class="el-icon-refresh-right"></i>
        </div>
      </div>
      <div class="record">
        <div class="start-record" @click="startRecord"
          v-if="cameraInfoList && cameraInfoList.cameraId && recordControl && !btnDisable">
          {{ recordTxt }}
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="btnDisable">{{ countdown2 }}</span>
        </div>
        <div class="start-record disbled" v-else>
          {{ recordTxt }}
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="btnDisable">{{ countdown2 }}</span>
        </div>
        <div class="record-list" @click="showRecord">
          录像列表
        </div>
      </div>
      <div class="controtwo">
        <div class="contro-left" @click="startcontrol(10)">
          焦距
          <i class="el-icon-plus"></i>
        </div>
        <div class="contro-right" @click="startcontrol(11)">
          焦距
          <i class="el-icon-minus"></i>
        </div>
      </div>
      <div class="controthree">
        <div class="greenbut" @click="startcontrol(8)">
          <i class="el-icon-zoom-in"></i> 放大
        </div>
        <div class="greenbut" @click="startcontrol(9)">
          <i class="el-icon-zoom-out"></i>缩小
        </div>
      </div>
    </div>
    <div v-else class="cameracontrol1">
      <!-- <div class="uncontrolsty-line">此设备不可控</div> -->
      <div class="controne">
        <div class="contro-m z-top">
          <i class="el-icon-caret-top"></i>
        </div>
        <div class="contro-m z-left">
          <i class="el-icon-caret-left"></i>
        </div>
        <div class="contro-m z-right">
          <i class="el-icon-caret-right"></i>
        </div>
        <div class="contro-m z-bottom">
          <i class="el-icon-caret-bottom"></i>
        </div>
        <div class="contro-m z-mirror">
          <i class="el-icon-refresh-right"></i>
        </div>
      </div>
      <div class="record">
        <div class="start-record" @click="startRecord"
          v-if="cameraInfoList && cameraInfoList.cameraId && recordControl && !btnDisable">
          {{ recordTxt }}
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="btnDisable">{{ countdown2 }}</span>
        </div>
        <div class="start-record disbled" v-else>
          {{ recordTxt }}
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="countShow">{{ countdown }}</span>
          <span v-if="btnDisable">{{ countdown2 }}</span>
        </div>
        <div class="record-list" @click="showRecord" v-if="judgePermission(3, 'control')">
          录像列表
        </div>
        <div class="record-list disbled" v-else>
          录像列表
        </div>
      </div>
      <div class="controtwo">
        <div class="contro-left">
          焦距
          <i class="el-icon-plus"></i>
        </div>
        <div class="contro-right">
          焦距
          <i class="el-icon-minus"></i>
        </div>
      </div>
      <div class="controthree">
        <div class="greenbut">
          <i class="el-icon-zoom-in"></i> 放大
        </div>
        <div class="greenbut">
          <i class="el-icon-zoom-out"></i>缩小
        </div>
      </div>
    </div>
    
    <el-dialog
      class="dialog-reord"
      title="录像列表"
      width="70%"
      :visible.sync="recordVisible"
    >
      <div class="video-record">
        <div class="video-list">
          <div class="video-title">
            视频列表
            <div class="refresh" @click="showRecord">刷新</div>
          </div>
          <div class="list" v-loading="recordLoading">
            <div class="video-one" v-for="item,i in videoList" :key="i" @click="videoClick(item, i)"
              :class="{ 'active': activeIndex === i }">
              <span class="txt">{{ item.name }}</span>
              <span class="export" @click.stop="exportVideo(item)">导出</span>
              <span class="remove" @click.stop="removeVideo(item)">删除</span>
            </div>
            <div class="nodata" v-if="!videoList.length">
              暂无数据
            </div>
          </div>
        </div>
        <div class="video-box">
          <video :src="videoUrl" class="video-con" controls></video>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import nowpagereq from "@/api/digital-production/material-link-monitoring/video-surveillance/index";
import { mapGetters } from "vuex";
import Axios from "axios";
// import throttle from 'lodash/throttle'
import debounce from 'lodash/debounce'
// import axios from 'axios'
export default {
  props: {
    cameralistparam: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      // 当前摄像头id
      cameraId: "",
      // 当前选中摄像头的详细信息
      cameraInfoList: {},
      // 摄像头列表
      cameraList: [],
      // 网页播放地址
      cameraurl: "",
      startUp: "",
      openSourceMark: "",
      timer: null, // 定时器
      timer1: null, // 定时器1
      // 路线
      recordTxt: '开始录制',
      recordVisible: false,
      videoList: [],
      videoUrl: '',
      activeIndex: '',
      countShow: false,
      countdown: 30,
      databaseName: 'DB_TDW1_PUBLIC',
      recordControl: false,
      countdown2: 5,
      btnDisable: false,
      recordLoading: false,
    };
  },
  computed: {
    ...mapGetters({
      judgePermission: "permission/judgePermission"
    })
  },
  watch: {
    cameralistparam(newval) {
      this.getcameralist();
    }
  },
  mounted() {},
  beforeDestroy () {
    this.recordTimer && clearInterval(this.recordTimer)
    this.timer5 && clearInterval(this.timer5)
    clearInterval(this.cameraTimer)
    // 离开界面销毁预热
    this.closePreheat();
    clearTimeout(this.timer);
    clearTimeout(this.timer1);
    this.timer = null;
    this.timer1 = null;
    this.cameraId = "";
    this.openSourceMark = "";
  },
  methods: {
    // 获取摄像头列表
    getcameralist () {
      this.$emit("nowcameraurl", "transCamera");
      let params = this.cameralistparam;
      params.organizationNo = sessionStorage.organizationNo;
      this.cameraList = [];
      if (!params.facilityNo) {
        this.timer1 = null;
        clearTimeout(this.timer1);
        return;
      }
      this.recordControl = false
      nowpagereq.queryByConditionCamera({
        facilityNo: params.facilityNo,
        organizationNo: sessionStorage.organizationNo,
        systemNo: sessionStorage.systemNo,
      }).then(res => {
        if (res.code === 1) {
          if (res.data.length >= 1) {
            this.cameraList = res.data;
            console.log("列表有摄像头");
            console.log(res.data);
            this.getcamermes(
              res.data[0]["camera"],
              res.data[0]["camera"]["startUp"]
            );
          } else {
            this.getcamermes(null, "false");
          }
        } else {
          this.getcamermes(null, "false");
          this.$emit("nowcameraurl", "notCameraList");
          console.log("列表请求摄像头失败");
        }
      });
    },
    // 获取某个摄像头详细信息
    getcamermes:debounce(async function(cameraInfo, newStartUp){
      this.recordControl = false
      clearTimeout(this.timer1);
      this.timer1 = null;
      this.$emit("nowcameraurl", "transCamera");
      if (this.startUp === "true") {
        this.closePreheat(this.cameraId);
        console.log("销毁预热");
      }
      if (!cameraInfo) {
        this.$emit("nowcameraurl", "notCameraList");
        console.log("列表无摄像头");
        this.cameraId = '';
        this.cameraName = '';
        this.startUp = newStartUp;
        return;
      }
      this.cameraId = cameraInfo.cameraId;
      this.cameraName = cameraInfo.cameraName;
      this.startUp = newStartUp;
      // 注意：startUp是字符串，不是Boolean
      if (newStartUp === "true") {
        this.openSourceMark = new Date().getTime();
        await Axios({
          method: "post",
          url:
            this.$cloudBaseurl + "solarEnergyCamera/openPower",
          data: { cameraId: cameraInfo.cameraId, openSourceMark: this.openSourceMark }
        }).then(
          res => {
            console.log(res);
            if (res.data.data.whetherPreheat) {
              // 子向父传值
              this.$emit("getUploadTime", res.data.data.openTime, this.startUp);
              console.log("预热加载");
              this.timer1 = setTimeout(() => {
                this.getSame(cameraInfo.cameraId);
              }, res.data.data.openTime * 60000);
            } else {
              this.getSame(cameraInfo.cameraId);
            }
          },
          err => {
            console.log(err);
          }
        );
      } else {
        this.openSourceMark = "";
        this.getSame(cameraInfo.cameraId);
      }
    },1000),
    // 封装获取摄像详细信息流量相关
    async getSame (id) {
      console.log(222)
      this.recordControl = true
      if (!(await this.getcams(id)) && id !== -1) {
        this.$emit("nowcameraurl", "downFlow");
        return;
      }
      this.cameraTimer = setInterval(async() => {
        if (!(await this.getcams(id)) && id !== -1) {
          this.$emit("nowcameraurl", "downFlow");
          clearInterval(this.cameraTimer)
        }
      }, 60 * 1000 * 10)
      nowpagereq.getcameramessage(id).then(res => {
        if (res.code === 1) {
          console.log(res.data);
          let data = res.data;
          this.cameraInfoList = data.camera;
          console.log("取得摄像头数据进行拼接");
          this.setcameraurl();
        }
      });
    },
    // 封装预热销毁函数
    async closePreheat(id) {
      await Axios({
        method: "post",
        url: this.$cloudBaseurl + "solarEnergyCamera/closePower",
        data: { cameraId: id, openSourceMark: this.openSourceMark }
      }).then(
        res => {
          console.log(res);
          console.log("预热销毁成功");
        },
        err => {
          console.log(err);
        }
      );
    },
    async getcams(id) {
      let zhurl =
        this.$cloudBaseurl +
        `cameraOperation/judgeFlow?cameraId=${id}`;
      const { data: res } = await Axios({
        method: "get",
        url: zhurl
      });
      // console.log(res)
      let data = res.data;
      if (res.code === 1) {
        // console.log(data.basis)
        if (data.flowUse) {
          this.$message.success(
            "总流量" + data.flowTotal + "已使用流量" + data.flowUse
          );
        }
        return data.basis;
      } else {
        this.$message.warning(res.msg || "未知错误！！！");
        return false;
      }
    },
    // 拼接摄像头地址
    setcameraurl() {
      // 判断有无摄像头
      if (this.cameraInfoList) {
        if (this.cameraInfoList.cameraInfo.status === 1) {
          // alert(this.cameraInfoList['deviceSerial'])
          this.cameraurl = "";
          // console.log(this.cameraInfoList)
          if (this.cameraInfoList) {
            this.cameraurl = `https://open.ys7.com/ezopen/h5/iframe?url=ezopen://open.ys7.com/${this.cameraInfoList["deviceSerial"]}/${this.cameraInfoList["channelNo"]}.hd.live&autoplay=1&accessToken=${this.cameraInfoList["accessToken"]}`;
          }
          this.$emit("nowcameraurl", this.cameraurl, { id: 'video-container', accessToken: this.cameraInfoList["accessToken"], url: `ezopen://open.ys7.com/${this.cameraInfoList["deviceSerial"]}/${this.cameraInfoList["channelNo"]}.hd.live` });
          this.timer = setTimeout(() => {
            this.$emit("nowcameraurl", "timeout");
          }, 1000 * 60 * 20);
        } else {
          this.$message.warning("摄像头不在线！请稍后重试");
          this.$emit("nowcameraurl", "notCameraData");
          return;
        }
      } else {
        // 无 传空
        // this.cameraurl = null
        this.$emit("nowcameraurl", "notCameraList");
      }
    },
    // 开始控制
    async startcontrol(i) {
      this.timer = setTimeout(() => {
        this.$emit("nowcameraurl", "timeout");
      }, 1000 * 60 * 20);
      let params = {
        cameraId: this.cameraId,
        direction: i,
        speed: 1
      };
      await nowpagereq.controlcamera(params).then(res => {
        if (res.code != 200) this.$message.error(res.msg);
      });
      setTimeout(() => {
        this.stopcontrol();
      }, 1000);
    },
    // 镜像翻转
    async mirrorcontrol() {
      this.timer = setTimeout(() => {
        this.$emit("nowcameraurl", "timeout");
      }, 1000 * 60 * 20);
      let params = {
        cameraId: this.cameraId,
        direction: 2,
        speed: 1
      };
      await nowpagereq.mirrorcamera(params);
      setTimeout(() => {
        this.stopcontrol();
      }, 1000);
    },
    // 停止控制
    stopcontrol() {
      let params = {
        cameraId: this.cameraId
      };
      nowpagereq.stopcamera(params).then(res => {
        // console.log(res)
      });
    },
    // 录制视频
    startRecord () {
      if (!this.countShow) {
        this.$confirm("是否开始录制?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
          customClass: "myClass"
        }).then(() => {
          Axios({
            method: "post",
            url: this.$baseurl.webServiceUrl + "v3/iot/videoRecord/add",
            headers: {
              databaseName: this.databaseName
            },
            data: {
              cameraId: this.cameraId,
              cameraName: this.cameraName,
              organizationNo: sessionStorage.organizationNo,
            }
          }).then(res => {
            if (res.data.code == 1 && res.data.data.taskId) {
              this.$message.success(res.data.msg)
              this.taskId = res.data.data.taskId
              this.countdown = 30
              this.countShow = true
              this.recordTxt = '中止 '
              // this.recordTxt = '录制中 '
              this.recordTimer = setInterval(() => {
                this.countdown--
                if (this.countdown <= 0) {
                  this.countShow = false
                  // this.recordTxt = '开始录制'
                  clearInterval(this.recordTimer)
                  this.timerFn()
                }
              }, 1000)
            } else {
              this.$message.error(res.data.msg)
            }
          });
        }).catch(() => {

        });
      } else {
        this.$confirm("是否中止录制?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
          customClass: "myClass"
        }).then(() => {
          Axios({
            method: "get",
            url: this.$baseurl.webServiceUrl + "v3/iot/videoRecord/stop?taskId=" + this.taskId,
            headers: {
              databaseName: this.databaseName
            },
            data: {
              organizationNo: sessionStorage.organizationNo,
            }
          }).then(res => {
            if (res.data.code == 1) {
              this.countShow = false
              // this.recordTxt = '开始录制'
              this.recordTimer && clearInterval(this.recordTimer)
              this.$message.success('中止成功')
              this.timerFn()
            } else {
              this.$message.error(res.data.msg)
            }
          })
        })
      }
    },
    timerFn () {
      this.countdown2 = 5
      this.recordTxt = '生成中'
      this.btnDisable = true
      this.timer5 = setInterval(() => {
        this.countdown2--
        if (this.countdown2 <= 0) {
          this.btnDisable = false
          this.recordTxt = '开始录制'
          clearInterval(this.timer5)
          this.queryRecordStatus()
        }
      }, 1000)
    },
    queryRecordStatus () {
      Axios({
        method: "get",
        url: this.$baseurl.webServiceUrl + "v3/iot/videoRecord/queryTaskInfo?taskId=" + this.taskId,
        headers: {
          databaseName: this.databaseName
        },
        data: {
          cameraId: this.cameraId,
          organizationNo: sessionStorage.organizationNo,
        }
      }).then(res => {
        if (res.data.code == 1) {
          let status = ''
          switch (res.data.data.taskStatus) {
            case 0:
              status = '已完成'
              break;
            case 1:
              status = '排队中'
              break;
            case 2:
              status = '进行中'
              break;
            case 3:
              status = '已结束'
              break;
            case 4:
              status = '异常结束'
              break;
            case 5:
              status = '暂停中'
              break;
            case 6:
              status = '已取消'
              break;
            case 7:
              status = '未开始'
              break;
            default:
              status = ''
              break;
          }
          this.$message.success(status)
        } else {
          this.$message.error(res.data.msg)
        }
      })
    },
    // 录像列表
    showRecord () {
      if (!this.cameraId) return
      this.recordLoading = true
      this.recordVisible = true
      Axios({
        method: "post",
        url: this.$baseurl.webServiceUrl + "v3/iot/videoRecord/queryRecordByCondition",
        headers: {
          databaseName: this.databaseName
        },
        data: {
          cameraId: this.cameraId,
          organizationNo: sessionStorage.organizationNo,
        }
      }).then(res => {
        this.recordLoading = false
        if (res.data.code == 1) {
          this.videoList = res.data.data
          if (this.videoList.length) {
            this.videoClick(this.videoList[0], 0)
          } else {
            this.videoUrl = ''
          }
        } else {
          this.videoList = []
          this.videoUrl = ''
        }
      })
    },
    videoClick (data, i) {
      this.activeIndex = i
      this.videoUrl = this.$baseurl.webServiceUrl + "v3/iot/videoRecord/videoView?videoRecordId=" + data.videoRecordId
    },
    exportVideo (data) {
      let url = this.$baseurl.webServiceUrl + "v3/iot/videoRecord/download?videoRecordId=" + data.videoRecordId
      let ele = document.createElement('a')
      ele.target = '_blank'
      ele.href = url
      ele.download = data.name
      ele.click()
      ele = null
    },
    removeVideo (data) {
      this.$confirm("确认删除录像吗?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "myClass"
      }).then(() => {
        Axios({
          method: "get",
          url: this.$baseurl.webServiceUrl + "v3/iot/videoRecord/del?videoRecordId=" + data.videoRecordId,
          headers: {
            databaseName: this.databaseName
          },
          data: {
            cameraId: this.cameraId,
            organizationNo: sessionStorage.organizationNo,
          }
        }).then(res => {
          if (res.data.code == 1) {
            this.showRecord()
          } else {
            this.$message.error(res.data.msg)
          }
        })
      }).catch(() => {
        
      });
    },
  }
};
</script>
<style lang="scss" scoped>
$height: 40px;
.uncontrolsty {
  width: 100%;
  height: calc(70% - 10px);
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  .uncontrolsty-line {
    color: #ccc;
    font-size: 30px;
    width: 30px;
    line-height: 50px;
  }
}
.allcameramain {
  height: 100%;
  width: 100%;
}
.cameralistmain {
  width: 100%;
  height: 35%;
  display: flex;
  flex-flow: nowrap column;
  align-items: center;
  justify-content: center;
  .camera-title {
    width: 80%;
    height: 30px;
    line-height: 30px;
    border: 1px solid #ccc;
    position: relative;
    z-index: 6;
    margin: 0 auto;
    text-align: center;
    background: #005d7b;
  }
  .camera-zlist {
    width: 100%;
    height: calc(100% - 20px);
    position: relative;
    z-index: 5;
    top: -10px;
    // display: flex;
    // flex-flow: nowrap column;
    // align-items: center;
    // justify-content: center;
    // text-align: center;
    // margin: 0 auto;
    border: #fff 2px dashed;
    overflow: auto;
    .camera-item {
      cursor: pointer;
      width: 80%;
      font-weight: 700;
      font-size: 20px;
      line-height: 40px;
      margin: 0 auto;
      height: $height;
      color: #fff;
      margin-bottom: 10px;
      border-radius: 5px;
      text-align: center;
      border: 1px solid #fff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .camera-item:nth-child(1) {
      margin-top: 20px;
    }
    .camera-item:hover {
      background-image: linear-gradient(to right, #46c357, #b3ec70, #46c357);
    }
    .beselect {
      background-image: linear-gradient(to right, #46c357, #b3ec70, #46c357);
    }
  }
}
.cameracontrol {
  width: 100%;
  height: calc(70% - 10px);
  margin-top: 10px;
  .controne {
    width: 100%;
    height: 50%;
    background-image: url("~@/assets/camera/ctrlBg.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: relative;
    .contro-m {
      // border: #46c357 1px solid;
      position: relative;
      width: 25%;
      height: 25%;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 40px;
      cursor: pointer;
    }
    .contro-m:hover {
      font-size: 48px;
    }
    .z-top {
      top: 10%;
      left: 37%;
    }
    .z-left {
      top: 12%;
      left: 11%;
    }
    .z-right {
      top: -13%;
      left: 63%;
    }
    .z-bottom {
      top: -10%;
      left: 37%;
    }
    .z-mirror {
      top: -63%;
      left: 37%;
    }
  }
  .controtwo {
    width: 100%;
    height: 15%;
    display: flex;
    justify-content: space-around;
    .contro-left {
      width: 48%;
      height: 100%;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      // border: #46c357 1px solid;
      background-image: url("~@/assets/camera/transformLeft.png");
      background-repeat: no-repeat;
      background-size: 70%;
      background-position: center;
      padding-right: 30px;
      cursor: pointer;
      font-size: 18px;
    }
    .contro-left:hover {
      font-size: 20px;
    }
    .contro-right {
      width: 48%;
      height: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      // border: #46c357 1px solid;
      background-image: url("~@/assets/camera/transformRight.png");
      background-repeat: no-repeat;
      background-size: 70%;
      background-position: center;
      padding-left: 30px;
      cursor: pointer;
      font-size: 18px;
    }
    .contro-right:hover {
      font-size: 20px;
    }
  }
  .controthree {
    width: 100%;
    height: 17%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    .greenbut {
      width: 28%;
      height: 60%;
      background-color: rgb(132, 180, 111);
      border-radius: 5px;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 600;
      font-size: 22px;
      cursor: pointer;
    }
    .greenbut:hover {
      font-size: 24px;
    }
  }
}
.cameracontrol1 {
  width: 100%;
  height: calc(70% - 10px);
  margin-top: 10px;
  .controne {
    width: 100%;
    height: 50%;
    background-image: url("~@/assets/camera/ctrlBg.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: relative;
    mix-blend-mode: soft-light;
    .contro-m {
      // border: #46c357 1px solid;
      position: relative;
      width: 25%;
      height: 25%;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 40px;
      cursor: pointer;
    }
    .z-top {
      top: 10%;
      left: 37%;
    }
    .z-left {
      top: 12%;
      left: 11%;
    }
    .z-right {
      top: -13%;
      left: 63%;
    }
    .z-bottom {
      top: -10%;
      left: 37%;
    }
    .z-mirror {
      top: -63%;
      left: 37%;
    }
  }
  .controtwo {
    width: 100%;
    height: 15%;
    display: flex;
    justify-content: space-around;
    .contro-left {
      width: 48%;
      height: 100%;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      // border: #46c357 1px solid;
      background-image: url("~@/assets/camera/transformLeft.png");
      background-repeat: no-repeat;
      background-size: 70%;
      background-position: center;
      padding-right: 30px;
      mix-blend-mode: soft-light;
      cursor: pointer;
      font-size: 18px;
    }
    .contro-right {
      width: 48%;
      height: 100%;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      // border: #46c357 1px solid;
      background-image: url("~@/assets/camera/transformRight.png");
      background-repeat: no-repeat;
      background-size: 70%;
      background-position: center;
      padding-left: 30px;
      mix-blend-mode: soft-light;
      cursor: pointer;
      font-size: 18px;
    }
  }
  .controthree {
    width: 100%;
    height: 17%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    mix-blend-mode: soft-light;
    .greenbut {
      width: 28%;
      height: 60%;
      background-color: rgb(132, 180, 111);
      border-radius: 5px;
      text-align: center;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 600;
      font-size: 22px;
      cursor: pointer;
    }
  }
}
.zlistbtn {
  display: flex;
  justify-content: center;
  align-items: center;
  .btn {
    border: none !important;
    height: 100%;
  }
}
.record {
  width: 100%;
  height: 15%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  &.disable {
    mix-blend-mode: soft-light;
  }
  .start-record {
    width: 28%;
    height: 60%;
    background-color: rgb(132, 180, 111);
    border-radius: 5px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    &.disbled {
      mix-blend-mode: soft-light;
    }
  }
  .record-list {
    width: 28%;
    height: 60%;
    background-color: rgb(132, 180, 111);
    border-radius: 5px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    &.disbled {
      mix-blend-mode: soft-light;
    }
  }
}
.dialog-reord {
  .video-record {
    display: flex;
    width: 100%;
    height: 100%;
    .video-list {
      width: 300px;
      margin-right: 5px;
      background-color: #006e91;
      color: #fff;
      padding: 15px;
      .video-title {
        width: 100%;
        font-size: 20px;
        text-align: center;
        border-bottom: #fff dashed 1px;
        padding-bottom: 10px;
        position: relative;
        .refresh {
          position: absolute;
          right: 0px;
          top: 7px;
          font-size: 16px;
          cursor: pointer;
        }
      }
      .list {
        width: 100%;
        height: calc(100% - 40px);
        overflow: hidden auto;
        font-size: 16px;
        margin-top: 10px;
        .video-one {
          padding: 5px 10px;
          border: #2f8aa2 1px solid;
          margin-bottom: 10px;
          cursor: pointer;
          &.active {
            background: #0cb28c;
          }
          span {
            display: inline-block;
            vertical-align: middle;
          }
          .txt {
            width: calc(100% - 80px);
            padding-right: 10px;
          }
          .export {
            width: 35px;
            margin-right: 10px;
            color: #64d9d6;
          }
          .remove {
            width: 35px;
            color: #ffd506;
          }
        }
      }
    }
    .video-box {
      width: calc(100% - 305px);
      border: 2px solid #000;
      .video-con {
        width: 100%;
        height: 100%;
        border: 3px solid #fff;
      }
    }
  }
  ::v-deep {
    .el-dialog {
      width: 70% !important;
      padding: 0 !important;
      .el-dialog__body {
        padding: 5px !important;
        height: calc(100% - 55px) !important;
        max-height: 100% !important;
      }
    }
  }
  .nodata {
    text-align: center;
  }
}
</style>
